<article class="post">
	<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
	<p class="post-info"><?php the_time('Y/m/d') ?> | by <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php the_author(); ?></a> | 类别
		<?php 
		$categaries = get_the_category();
		$separator = ", ";
		$output =  '';

		if ($categaries) {
			foreach ($categaries as $categary) {
				$output .= '<a href="' . get_category_link($categary->term_id) . '">' . $categary->cat_name . '</a>' . $separator;
			}

			echo trim($output, $separator);

		}
		?>  |
		<?php if ( comments_open() ) : 
			comments_popup_link( '评论内容', '1 条评论', '% 条评论', 'comments-link', '评论被禁用了'); 
		endif; ?> 
		| <i class="i-user"><?php if(function_exists('the_views')) { the_views(); } ?></i>


	</p>

	<?php if ( is_search() OR is_archive() ) { ?>
		<p>
			<?php echo get_the_excerpt(); ?>
			<a href="<?php the_permalink(); ?>">阅读全文</a>
		</p>

	<?php } else {
		if ($post->post_excerpt) { ?>
			<div class="index-img">
				<?php the_post_thumbnail('small-thumbnail'); ?>
			</div>
			
			<p>
				<?php echo get_the_excerpt(); ?>
				<a href="<?php the_permalink(); ?>">阅读全文</a>		
			</p>			
			
		<?php } else { ?>

			<div class="index-img">
				<?php the_post_thumbnail('small-thumbnail'); ?>
			</div>
		
			<p>
				<?php echo get_the_excerpt(); ?>
				<a href="<?php the_permalink(); ?>">阅读全文</a>			
			</p>
			
		<?php } 
	}?>

</article>